<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Dirichlet function</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Dirichlet_function"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Dirichlet_function rootpage-Dirichlet_function skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Dirichlet function</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">For the other function sometimes incorrectly called the Dirichlet function, see <a href="Dirichlet_kernel" title="Dirichlet kernel">Dirichlet kernel</a>.</div>
<p>In <a href="Mathematics" title="Mathematics">mathematics</a>, the <b>Dirichlet function</b><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> is the <a href="Indicator_function" title="Indicator function">indicator function</a> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {1} _{\mathbb {Q} }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mn mathvariant="bold">1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Q</mi>
</mrow>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {1} _{\mathbb {Q} }}</annotation>
</semantics>
</math></span><img src="./9e49bd45fd57b71a4050878506a5f2e6719fbfef.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:2.847ex; height:2.676ex;" alt="{\displaystyle \mathbf {1} _{\mathbb {Q} }}" loading="lazy"></span> of the set of <a href="Rational_number" title="Rational number">rational numbers</a> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Q} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Q</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Q} }</annotation>
</semantics>
</math></span><img src="./c5909f0b54e4718fa24d5fd34d54189d24a66e9a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.808ex; height:2.509ex;" alt="{\displaystyle \mathbb {Q} }" loading="lazy"></span> over the set of <a href="Real_number" title="Real number">real numbers</a> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {R} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">R</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {R} }</annotation>
</semantics>
</math></span><img src="./786849c765da7a84dbc3cce43e96aad58a5868dc.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.678ex; height:2.176ex;" alt="{\displaystyle \mathbb {R} }" loading="lazy"></span>, i.e. <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {1} _{\mathbb {Q} }(x)=1}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mn mathvariant="bold">1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Q</mi>
</mrow>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mn>1</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {1} _{\mathbb {Q} }(x)=1}</annotation>
</semantics>
</math></span><img src="./3638e1da26e9032c99ca7118783e4bbb91b7bf14.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:10.247ex; height:2.843ex;" alt="{\displaystyle \mathbf {1} _{\mathbb {Q} }(x)=1}" loading="lazy"></span> for a real number <span class="texhtml mvar" style="font-style:italic;">x</span> if <span class="texhtml mvar" style="font-style:italic;">x</span> is a rational number and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {1} _{\mathbb {Q} }(x)=0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mn mathvariant="bold">1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Q</mi>
</mrow>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {1} _{\mathbb {Q} }(x)=0}</annotation>
</semantics>
</math></span><img src="./52fa2d4269db667a8e6b07344666f4cfbf1c7ff0.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:10.247ex; height:2.843ex;" alt="{\displaystyle \mathbf {1} _{\mathbb {Q} }(x)=0}" loading="lazy"></span> if <span class="texhtml mvar" style="font-style:italic;">x</span> is not a rational number (i.e. is an <a href="Irrational_number" title="Irrational number">irrational number</a>).
<span class="mwe-math-element mwe-math-element-block"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"><math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {1} _{\mathbb {Q} }(x)={\begin{cases}1&x\in \mathbb {Q} \\0&x\notin \mathbb {Q} \end{cases}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mn mathvariant="bold">1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Q</mi>
</mrow>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow>
<mo>{</mo>
<mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false">
<mtr>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mi>x</mi>
<mo>∈<!-- ∈ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Q</mi>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>0</mn>
</mtd>
<mtd>
<mi>x</mi>
<mo>∉<!-- ∉ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Q</mi>
</mrow>
</mtd>
</mtr>
</mtable>
<mo fence="true" stretchy="true" symmetric="true"></mo>
</mrow>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {1} _{\mathbb {Q} }(x)={\begin{cases}1&x\in \mathbb {Q} \\0&x\notin \mathbb {Q} \end{cases}}}</annotation>
</semantics>
</math></span></span>
</p><p>It is named after the mathematician <a href="Peter_Gustav_Lejeune_Dirichlet" title="Peter Gustav Lejeune Dirichlet">Peter Gustav Lejeune Dirichlet</a>.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> It is an example of a <a href="Pathological_(mathematics)" title="Pathological (mathematics)">pathological function</a> which provides counterexamples to many situations.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Topological_properties">Topological properties</h2></div>
<div><ul><li>The Dirichlet function is <a href="Nowhere_continuous_function" title="Nowhere continuous function">nowhere continuous</a>. We can prove this by reference to the definition of a <a href="Continuous_function" title="Continuous function">continuous function</a> to show that it violates the continuity properties at both rational and irrational arguments:
<style data-mw-deduplicate="TemplateStyles:r1174254338">
/* start https://en.wikipedia.org/ */
.mw-parser-output .math_proof{border:thin solid #aaa;margin:1em 2em;padding:0.5em 1em 0.4em}@media(max-width:500px){.mw-parser-output .math_proof{margin:1em 0;padding:0.5em 0.5em 0.4em}}
/* end https://en.wikipedia.org/ */
</style><div class="math_proof" style=""><strong>Proof</strong>
<ul><li>If <span class="texhtml mvar" style="font-style:italic;">y</span> is rational, then <span class="nowrap"><span class="texhtml"><var style="padding-right: 1px;">f</var>(<var style="padding-right: 1px;">y</var>) = 1</span></span>. To show the function is not continuous at <span class="texhtml mvar" style="font-style:italic;">y</span>, we need to find an <span class="texhtml mvar" style="font-style:italic;">ε</span> such that no matter how small we choose <span class="texhtml mvar" style="font-style:italic;">δ</span>, there will be points <span class="texhtml mvar" style="font-style:italic;">z</span> within <span class="texhtml mvar" style="font-style:italic;">δ</span> of <span class="texhtml mvar" style="font-style:italic;">y</span> such that <span class="texhtml"><var style="padding-right: 1px;">f</var>(<var style="padding-right: 1px;">z</var>)</span> is not within <span class="texhtml mvar" style="font-style:italic;">ε</span> of <span class="nowrap"><span class="texhtml"><var style="padding-right: 1px;">f</var>(<var style="padding-right: 1px;">y</var>) = 1</span></span>. In fact, <style data-mw-deduplicate="TemplateStyles:r1154941027">
/* start https://en.wikipedia.org/ */
.mw-parser-output .frac{white-space:nowrap}.mw-parser-output .frac .num,.mw-parser-output .frac .den{font-size:80%;line-height:0;vertical-align:super}.mw-parser-output .frac .den{vertical-align:sub}.mw-parser-output .sr-only{border:0;clip:rect(0,0,0,0);clip-path:polygon(0px 0px,0px 0px,0px 0px);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}
/* end https://en.wikipedia.org/ */
</style><span class="frac"><span class="num">1</span>⁄<span class="den">2</span></span> is such an <span class="texhtml mvar" style="font-style:italic;">ε</span>. Because the <a href="Irrational_number" title="Irrational number">irrational numbers</a> are <a href="Dense_set" title="Dense set">dense</a> in the reals, no matter what <span class="texhtml mvar" style="font-style:italic;">δ</span> we choose we can always find an irrational <span class="texhtml mvar" style="font-style:italic;">z</span> within <span class="texhtml mvar" style="font-style:italic;">δ</span> of <span class="texhtml mvar" style="font-style:italic;">y</span>, and <span class="nowrap"><span class="texhtml"><var style="padding-right: 1px;">f</var>(<var style="padding-right: 1px;">z</var>) = 0</span></span> is at least <span class="frac"><span class="num">1</span>⁄<span class="den">2</span></span> away from 1.</li>
<li>If <span class="texhtml mvar" style="font-style:italic;">y</span> is irrational, then <span class="nowrap"><span class="texhtml"><var style="padding-right: 1px;">f</var>(<var style="padding-right: 1px;">y</var>) = 0</span></span>. Again, we can take <span class="nowrap"><span class="texhtml"><var style="padding-right: 1px;">ε</var> = <span class="frac"><span class="num">1</span>⁄<span class="den">2</span></span></span></span>, and this time, because the rational numbers are dense in the reals, we can pick <span class="texhtml mvar" style="font-style:italic;">z</span> to be a rational number as close to <span class="texhtml mvar" style="font-style:italic;">y</span> as is required. Again, <span class="nowrap"><span class="texhtml"><var style="padding-right: 1px;">f</var>(<var style="padding-right: 1px;">z</var>) = 1</span></span> is more than <span class="frac"><span class="num">1</span>⁄<span class="den">2</span></span> away from <span class="nowrap"><span class="texhtml"><var style="padding-right: 1px;">f</var>(<var style="padding-right: 1px;">y</var>) = 0</span></span>.</li></ul>
</div>
Its restrictions to the set of rational numbers and to the set of irrational numbers are <a href="Constant_function" title="Constant function">constants</a> and therefore continuous. The Dirichlet function is an archetypal example of the <a href="Blumberg_theorem" title="Blumberg theorem">Blumberg theorem</a>.</li><li>The Dirichlet function can be constructed as the double pointwise limit of a sequence of continuous functions, as follows:
<span class="mwe-math-element mwe-math-element-block"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"><math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \forall x\in \mathbb {R} ,\quad \mathbf {1} _{\mathbb {Q} }(x)=\lim _{k\to \infty }\left(\lim _{j\to \infty }\left(\cos(k!\pi x)\right)^{2j}\right)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi mathvariant="normal">∀<!-- ∀ --></mi>
<mi>x</mi>
<mo>∈<!-- ∈ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">R</mi>
</mrow>
<mo>,</mo>
<mspace width="1em"></mspace>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mn mathvariant="bold">1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Q</mi>
</mrow>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<munder>
<mo movablelimits="true" form="prefix">lim</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo stretchy="false">→<!-- → --></mo>
<mi mathvariant="normal">∞<!-- ∞ --></mi>
</mrow>
</munder>
<mrow>
<mo>(</mo>
<mrow>
<munder>
<mo movablelimits="true" form="prefix">lim</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
<mo stretchy="false">→<!-- → --></mo>
<mi mathvariant="normal">∞<!-- ∞ --></mi>
</mrow>
</munder>
<msup>
<mrow>
<mo>(</mo>
<mrow>
<mi>cos</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>k</mi>
<mo>!</mo>
<mi>π<!-- π --></mi>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mrow>
<mo>)</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
<mi>j</mi>
</mrow>
</msup>
</mrow>
<mo>)</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \forall x\in \mathbb {R} ,\quad \mathbf {1} _{\mathbb {Q} }(x)=\lim _{k\to \infty }\left(\lim _{j\to \infty }\left(\cos(k!\pi x)\right)^{2j}\right)}</annotation>
</semantics>
</math></span></span>
for integer <span class="texhtml mvar" style="font-style:italic;">j</span> and <span class="texhtml mvar" style="font-style:italic;">k</span>. This shows that the Dirichlet function is a <a href="Baire_function" title="Baire function">Baire class</a> 2 function. It cannot be a Baire class 1 function because a Baire class 1 function can only be discontinuous on a <a href="Meagre_set" title="Meagre set">meagre set</a>.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup></li></ul></div>
<div class="mw-heading mw-heading2"><h2 id="Periodicity">Periodicity</h2></div>
<p>For any real number <span class="texhtml mvar" style="font-style:italic;">x</span> and any positive rational number <span class="texhtml mvar" style="font-style:italic;">T</span>, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {1} _{\mathbb {Q} }(x+T)=\mathbf {1} _{\mathbb {Q} }(x)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mn mathvariant="bold">1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Q</mi>
</mrow>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo>+</mo>
<mi>T</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mn mathvariant="bold">1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Q</mi>
</mrow>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {1} _{\mathbb {Q} }(x+T)=\mathbf {1} _{\mathbb {Q} }(x)}</annotation>
</semantics>
</math></span><img src="./186581851a8357f562eeeaa2822cd850e7848c5e.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:19.548ex; height:2.843ex;" alt="{\displaystyle \mathbf {1} _{\mathbb {Q} }(x+T)=\mathbf {1} _{\mathbb {Q} }(x)}" loading="lazy"></span>. The Dirichlet function is therefore an example of a real <a href="Periodic_function" title="Periodic function">periodic function</a> which is not <a href="Constant_function" title="Constant function">constant</a> but whose set of periods, the set of rational numbers, is a <a href="Dense_set" title="Dense set">dense subset</a> of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {R} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">R</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {R} }</annotation>
</semantics>
</math></span><img src="./786849c765da7a84dbc3cce43e96aad58a5868dc.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.678ex; height:2.176ex;" alt="{\displaystyle \mathbb {R} }" loading="lazy"></span>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Integration_properties">Integration properties</h2></div>
<div><ul><li>The Dirichlet function is not <a href="Riemann_integral" title="Riemann integral">Riemann-integrable</a> on any segment of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {R} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">R</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {R} }</annotation>
</semantics>
</math></span><img src="./786849c765da7a84dbc3cce43e96aad58a5868dc.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.678ex; height:2.176ex;" alt="{\displaystyle \mathbb {R} }" loading="lazy"></span> despite being bounded because the set of its discontinuity points is not <a href="Negligible_set" title="Negligible set">negligible</a> (for the <a href="Lebesgue_measure" title="Lebesgue measure">Lebesgue measure</a>).</li><li>The Dirichlet function has both an upper <a href="Darboux_integral" title="Darboux integral">Darboux integral</a> (namely, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle b-a}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>b</mi>
<mo>−<!-- − --></mo>
<mi>a</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle b-a}</annotation>
</semantics>
</math></span><img src="./ecca61f9c918fe1deb227ed79d4979d70c443ea4.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:5.068ex; height:2.343ex;" alt="{\displaystyle b-a}" loading="lazy"></span>) and a lower Darboux integral (0) over any bounded interval <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle [a,b]}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">[</mo>
<mi>a</mi>
<mo>,</mo>
<mi>b</mi>
<mo stretchy="false">]</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle [a,b]}</annotation>
</semantics>
</math></span><img src="./9c4b788fc5c637e26ee98b45f89a5c08c85f7935.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.555ex; height:2.843ex;" alt="{\displaystyle [a,b]}" loading="lazy"></span> — but they are not equal if <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a<b}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>a</mi>
<mo><</mo>
<mi>b</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle a<b}</annotation>
</semantics>
</math></span><img src="./91a7698e4c7401bb321f97888b872b583a9e4642.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:5.326ex; height:2.176ex;" alt="{\displaystyle a<b}" loading="lazy"></span>, so the Dirichlet function is not Darboux-integrable (and therefore not Riemann-integrable) over any nondegenerate interval.</li><li>The Dirichlet function provides a counterexample showing that the <a href="Monotone_convergence_theorem" title="Monotone convergence theorem">monotone convergence theorem</a> is not true in the context of the Riemann integral.
<div class="math_proof" style=""><strong>Proof</strong>
<p>Using an <a href="Enumeration" title="Enumeration">enumeration</a> of the rational numbers between 0 and 1, we define the function <span class="texhtml"><var style="padding-right: 1px;">f</var><sub><var style="padding-right: 1px;">n</var></sub></span> (for all nonnegative integer <span class="texhtml mvar" style="font-style:italic;">n</span>) as the indicator function of the set of the first <span class="texhtml mvar" style="font-style:italic;">n</span> terms of this sequence of rational numbers. The increasing sequence of functions <span class="texhtml"><var style="padding-right: 1px;">f</var><sub><var style="padding-right: 1px;">n</var></sub></span> (which are nonnegative, Riemann-integrable with a vanishing integral) pointwise converges to the Dirichlet function which is not Riemann-integrable.
</p>
</div></li><li>The Dirichlet function is <a href="Lebesgue_integral" title="Lebesgue integral">Lebesgue-integrable</a> on <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {R} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">R</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {R} }</annotation>
</semantics>
</math></span><img src="./786849c765da7a84dbc3cce43e96aad58a5868dc.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.678ex; height:2.176ex;" alt="{\displaystyle \mathbb {R} }" loading="lazy"></span> and its integral over <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {R} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">R</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {R} }</annotation>
</semantics>
</math></span><img src="./786849c765da7a84dbc3cce43e96aad58a5868dc.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.678ex; height:2.176ex;" alt="{\displaystyle \mathbb {R} }" loading="lazy"></span> is zero because it is zero except on the set of rational numbers which is negligible (for the Lebesgue measure).</li></ul></div>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Thomae's_function" title="Thomae's function">Thomae's function</a>, a variation that is discontinuous only at the rational numbers</li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite class="citation cs2"><a rel="nofollow" class="external text" href="https://www.encyclopediaofmath.org/index.php?title=Dirichlet-function">"Dirichlet-function"</a>, <i><a href="Encyclopedia_of_Mathematics" title="Encyclopedia of Mathematics">Encyclopedia of Mathematics</a></i>, <a href="European_Mathematical_Society" title="European Mathematical Society">EMS Press</a>, 2001 [1994]</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://mathworld.wolfram.com/DirichletFunction.html">Dirichlet Function — from MathWorld</a></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite id="CITEREFLejeune_Dirichlet1829" class="citation journal cs1">Lejeune Dirichlet, Peter Gustav (1829). <a rel="nofollow" class="external text" href="https://eudml.org/doc/183134">"Sur la convergence des séries trigonométriques qui servent à représenter une fonction arbitraire entre des limites données"</a>. <i>Journal für die reine und angewandte Mathematik</i>. <b>4</b>: <span class="nowrap">157–</span>169.</cite> The function is defined on page 169</span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite id="CITEREFDunham2005" class="citation book cs1">Dunham, William (2005). <i>The Calculus Gallery</i>. <a href="Princeton_University_Press" title="Princeton University Press">Princeton University Press</a>. p. 197. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0-691-09565-5</bdi>.</cite></span>
</li>
</ol></div></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-07-01" href="https://en.wikipedia.org/wiki/?title=Dirichlet_function&oldid=1298314995">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>